<template>
	<view class="environment">
		<view class="back">
			<view class="back-top">
				<image class="back-img" @click="back" src="../../../static/index/fanhui.png" mode=""></image>
				<text class="back-name">公益环保</text>
			</view>
			<view class="back-bottom">
				<view class="back-bottom-box">
					<text class="tabs" @click="clickTabs(index)" :class="{tabsActive:num==index}" v-for="(item,index) in tabsList" :key="index">{{item}}</text>
				</view>
			</view>
			<view class="content" v-show="num==0">
				<view class="donate" style="background-image: url('../../../static/publicwelfare/juan.png');">
					<image class="donate-img" src="../../../static/publicwelfare/tujian.png" mode=""></image>
					<text style="margin-top:180rpx;margin-left: 40rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="donate-box">
						<view class="one">南宁市留守儿童  <text style="font-size: 12px;font-weight: 400;color: #999999;">（广西壮族自治区南宁市）</text></view>
						<view class="two">助力进度  <text>44，228，125/55,666,000积分</text></view>
						<view class="percentage" style="display: flex;">
							<u-line-progress height="14" style="width: 440rpx;" active-color='#FF7200' :percent="70" :show-percent="false"></u-line-progress>
						</view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
			</view>
			<view class="content" v-show="num==1">
				<view class="donate" style="background-image: url('../../../static/publicwelfare/juan.png');">
					<image class="donate-img" src="../../../static/publicwelfare/tujian.png" mode=""></image>
					<text style="margin-top:180rpx;margin-left: 40rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="donate-box">
						<view class="one">南宁市留守儿童  <text style="font-size: 12px;font-weight: 400;color: #999999;">（广西壮族自治区南宁市）</text></view>
						<view class="two">助力进度  <text>44，228，125/55,666,000积分</text></view>
						<view class="percentage" style="display: flex;">
							<u-line-progress height="14" style="width: 440rpx;" active-color='#FF7200' :percent="70" :show-percent="false"></u-line-progress>
						</view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
			</view>
			<view class="content" v-show="num==2">
				<view class="donate" style="background-image: url('../../../static/publicwelfare/juan.png');">
					<image class="donate-img" src="../../../static/publicwelfare/tujian.png" mode=""></image>
					<text style="margin-top:180rpx;margin-left: 40rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="donate-box">
						<view class="one">南宁市留守儿童  <text style="font-size: 12px;font-weight: 400;color: #999999;">（广西壮族自治区南宁市）</text></view>
						<view class="two">助力进度  <text>44，228，125/55,666,000积分</text></view>
						<view class="percentage" style="display: flex;">
							<u-line-progress height="14" style="width: 440rpx;" active-color='#FF7200' :percent="70" :show-percent="false"></u-line-progress>
						</view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
			</view>
			<view class="content" v-show="num==3">
				<view class="donate" style="background-image: url('../../../static/publicwelfare/juan.png');">
					<image class="donate-img" src="../../../static/publicwelfare/tujian.png" mode=""></image>
					<text style="margin-top:180rpx;margin-left: 40rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="donate-box">
						<view class="one">南宁市留守儿童  <text style="font-size: 12px;font-weight: 400;color: #999999;">（广西壮族自治区南宁市）</text></view>
						<view class="two">助力进度  <text>44，228，125/55,666,000积分</text></view>
						<view class="percentage" style="display: flex;">
							<u-line-progress height="14" style="width: 440rpx;" active-color='#FF7200' :percent="70" :show-percent="false"></u-line-progress>
						</view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
				<view class="donate" style="background-image: url('../../../static/publicwelfare/yinshui.png'); padding: 40rpx;">
					<text style="margin-top:180rpx; 32rpx;font-weight: 400;color: #FFFFFF;">为留守儿童点亮一盏灯（10积分起捐）</text>
					<view class="percentage" style="display: flex;">
						<u-line-progress height="14" style="width: 440rpx;" active-color='#FF0000' :percent="70" :show-percent="false"></u-line-progress>
					</view>
					<view class="donate-box2">
						<view class="donate-box2-one"><text>今日已捐</text>  <text>6，753，699积分</text></view>
						<view class="donate-box2-one"><text>今日目标</text>  <text>8，753，000积分</text></view>
						<text class="jifen-btn" style="position: absolute;bottom: 16rpx;right: 26rpx;">去捐积分</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getwelfareList} from '@/service/publicWelfare.js';//公益环保列表接口
	export default {
		data() {
			return {
				params:{
					limit:10,
					page:1,
					type:1,//默认是公益助学
				},
				num:0,
				tabsList:['公益助学','好风尚','敬老扶残','真善举'],
				donationList:[{title:'情暖冬日，寒冬也暖暖'},{title:'情暖冬日，寒冬也暖暖'},{title:'情暖冬日，寒冬也暖暖'},{title:'情暖冬日，寒冬也暖暖'}]
			}
		},
		onLoad() {
			this.getwelfareList()
		},
		methods: {
			getwelfareList(){
				getwelfareList(this.params).then(res=>{
					console.log(res,'数据');
				})
			},
			back() {
				uni.navigateBack()
			},
			//顶部tabs切换
			clickTabs(index){
				this.num = index
				if(index=0){
					this.params.type=1
					this.getwelfareList()
				}
				if(index=1){
					this.params.type=2
					this.getwelfareList()
				}
				if(index=2){
					this.params.type=3
					this.getwelfareList()
				}
				if(index=3){
					this.params.type=4
					this.getwelfareList()
				}
			},
			edit(type){
				if(type==0){//公益助学详情
					uni.navigateTo({
						url:'/myPackageA/index/environment/environmentEdit'
					})
				}
			}
		}
	}
</script>

<style scoped lang="less">
	.donate-box2{
		display: flex;
		.donate-box2-one{
			margin-right: 100rpx;
			display: flex;
			flex-direction: column;
			text:first-child{
				font-size: 16rpx;
				font-family: Source Han Sans CN;
				font-weight: 300;
				color: #FFFFFF;
			}
			text:last-child{
				font-size: 20rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #FFFFFF;
			}
		}
		.jifen-btn{
			width: 100rpx;
			height: 40rpx;
			line-height: 40rpx;
			text-align: center;
			border: 2rpx solid #FFFFFF;
			opacity: 1;
			border-radius: 24rpx;
			font-size: 20rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #FFFFFF;
		}
	}
	.content{
		padding: 52rpx;
		.Donation-module{
			display: flex;
			justify-content: space-between;
			width: 100%;
			padding-bottom: 40rpx;
			flex-wrap: wrap;
			.Donation-module-box{
				width: 47%;
				height: auto;
				background: #FFFFFF;
				box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16);
				border-radius: 20rpx;
				margin-bottom: 30rpx;
				padding: 10rpx;
				display: flex;
				flex-direction: column;
				position: relative;
				.btn-integral{
					position: absolute;
					bottom: 10rpx;
					right: 22rpx;
					width: 100rpx;
					height: 40rpx;
					line-height: 40rpx;
					text-align: center;
					background: #FF3333;
					opacity: 1;
					border-radius: 24rpx;
					font-size: 20rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #FFFFFF;
				}
				image{
					width: 100%;
					height: 200rpx;
				}
				.title{
					padding: 0 10rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #333333;
				}
				.num-integral{
					padding: 0 10rpx;
					font-size: 28rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #666666;
					margin: 10rpx 0;
				}
				.statistics{
					font-size: 20rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #999999;
					padding: 0 10rpx;
				}
			}
		}
		.donate{
			width: 100%;
			height: 372rpx;
			background-repeat: no-repeat;
			background-size: 100% 100%;
			position: relative;
			display: flex;
			flex-direction: column;
			margin-bottom: 30rpx;
			.donate-box{
				position: relative;
				align-self: center;
				display: flex;
				flex-direction: column;
				width: 608rpx;
				height: 136rpx;
				background: #FFFFFF;
				border-radius: 10rpx;
				padding: 20rpx;
				.jifen-btn{
					width: 100rpx;
					height: 40rpx;
					background: #FF3333;
					border-radius: 24rpx;
					line-height: 40rpx;
					text-align: center;
					color: #FFFFFF;
					font-size: 20rpx;
					margin-left: 26rpx;
				}
				.one{
					font-size: 24rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #333333;
				}
				.two{
					font-size: 24rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #333333;
					margin: 8rpx 0;
				}
			}
			.donate-img{
				position: absolute;
				top: -10px;
				left: -12px;
				width: 96rpx;
				height: 112rpx;
			}
		}
	}
.back {
		padding-top: 80rpx;
		width: 100%;
		height: 292rpx;
		background-color: #24AE3E;
		padding-left: 0rpx !important;
		padding-right: 0 !important;
		.back-bottom{
			width: 90%;
			margin:30rpx 5% ;
			height: 84rpx;
			background: #FFFFFF;
			opacity: 1;
			padding: 6rpx;
			.back-bottom-box{
				background: #ECEAEA;
				height: 100%;
				display: flex;
				.tabs{
					flex: 1;
					display: flex;
					align-items: center;
					justify-content: center;
					height: 100%;
					border-right: 2px solid #FFFFFF;
					font-size: 32rpx;
					font-family: Source Han Sans CN;
					font-weight: bold;
					color: #999999;
				}
				.tabsActive{
					color: #FFFFFF;
					background-color: #FF7200;
				}
			}
		}
		.back-top{
			display: flex;
			align-self: center;
			.back-img {
				width: 40rpx;
				height: 40rpx;
				margin-top: 10rpx;
				margin-left: 40rpx;
			}
			
			.back-name {
				font-size: 18px;
				line-height: 31px;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #FFFFFF;
				margin-right: 18rpx;
			}
		}
		
	}
</style>
